﻿using ResxHelper.Object;

namespace ResxHelper.Logic.Writers
{
    public class ResourceFileIOSFormatter : IResourceFileFormatter
    {
        public ResourceFile InputFile { get; private set; }

        public ResourceFileIOSFormatter(ResourceFile input)
        {
            InputFile = input;
        }

        public string Run()
        {
            var resourceFileText = string.Empty;
            foreach (var entry in InputFile.Entries)
            {
                var fileEntry = entry.Value;
                var line = string.Format("\"{0}\" = \"{1}\";\r\n", fileEntry.Key, fileEntry.Value);
                resourceFileText += line;
            }
            return resourceFileText;
        }


    }
}
